on

abstract fun <E : T?> on(eventClass: Class<E>, observer: Observer<E>): Subscription

Subscribes the given event observer to receive the events of the given eventClass. The order in which notifications will be delivered to the registered listeners is not specified. The method does nothing if the given observer has been already registered.

Return

a Subscription reference with which the subscribers can unsubscribe from the Observable. If the given observer is already registered, returns a reference to already created Subscription.

Parameters

eventClass

the event class

observer

the event observer to subscribe

<E>

the event type